#!/bin/bash

if [ -z "$CLIENT_JDK" ]; then
  CLIENT_JDK=$JAVA_HOME
  if [ -z "$CLIENT_JDK" ]; then
    echo ERROR: cannot start DoradoClient.
    echo No JDK found to run DoradoClient. Please validate either JAVA_HOME points to valid JDK installation
  fi
fi

echo $CLIENT_JDK

SCRIPT_LOCATION=$0
CLIENT_PATH=`dirname "$SCRIPT_LOCATION"`
JETTY_PATH="$CLIENT_PATH/jetty"
JETTY_JAR_NAME="start.jar"

cd $JETTY_PATH

exec $CLIENT_JDK/bin/java -jar $JETTY_JAR_NAME $*
